﻿using System;
using System.IO;
using _5E.Infrastructure.Logging;
using log4net;
using log4net.Config;
using WholesaleOnline.Infrastructure.Configuration;

namespace WholesaleOnline.Infrastructure.Logging
{
    public class Log4NetAdapter : ILogger
    {
        private ILog m_log = null;

        public Log4NetAdapter()
        {
            FileInfo file = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.xml");
            XmlConfigurator.ConfigureAndWatch(file);
            m_log = LogManager.GetLogger(MyApplicationSettingsFactory.ApplicationSettings.LogName);
        }

        public void Log(string message)
        {
            m_log.Info(message);
        }
    }
}
